From: Florian Müllner Date: Sun, 22 Mar 2020 20:14:34 +0000 (+0100) Subject: unlockDialog: Handle embedded newlines in notifications X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~751^2^2~85 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=61beccf7334aa0679325af180e3e1e07af034ace;p=gnome-shell.git unlockDialog: Handle embedded newlines in notifications Detailed notifications are meant to be single line, just as unexpanded notification banners. So handle them the same way as in the message list, and replace embedded newlines by spaces. https://gitlab.gnome.org/GNOME/gnome-shell/issues/2463 --- diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 33635fdd0..d27b1d59c 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -115,7 +115,7 @@ var NotificationsBox = GObject.registerClass({ box.add_child(textBox); let title = new St.Label({ - text: source.title, + text: source.title.replace(/\n/g, ' '), style_class: 'unlock-dialog-notification-label', }); textBox.add(title); @@ -129,9 +129,10 @@ var NotificationsBox = GObject.registerClass({ let body = ''; if (n.bannerBodyText) { + const bodyText = n.bannerBodyText.replace(/\n/g, ' '); body = n.bannerBodyMarkup - ? n.bannerBodyText - : GLib.markup_escape_text(n.bannerBodyText, -1); + ? bodyText + : GLib.markup_escape_text(bodyText, -1); } let label = new St.Label({ style_class: 'unlock-dialog-notification-count-text' });